#define _CRT_SECURE_NO_WARNINGS
class MyQueue {
public:
    MyQueue() {

    }

    void push(int x) {
        stIn.push(x);
    }

    int pop() {
        if (stOut.empty())
        {
            while (!stIn.empty())
            {
                int x = stIn.top();
                stIn.pop();
                stOut.push(x);
            }
        }
        int x = stOut.top();
        stOut.pop();
        return x;
    }

    int peek() {
        int x = this->pop();
        stOut.push(x);
        return x;
    }

    bool empty() {
        return stIn.empty() && stOut.empty();
    }
private:
    stack<int> stIn;
    stack<int> stOut;
};

/**
 * Your MyQueue object will be instantiated and called as such:
 * MyQueue* obj = new MyQueue();
 * obj->push(x);
 * int param_2 = obj->pop();
 * int param_3 = obj->peek();
 * bool param_4 = obj->empty();
 */